package w83a.w83aOperacionesPaso.w83aLotesPreavisos;



import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang.StringUtils;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import w83a.w83aBeans.W83aLotesPreavisosBean;

import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;
import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;

public class W83aObtenerPreavisoIndiceOP extends Q70ActionPasoOP{

	
	protected void processOP(Q70ContextoEJIE contexto, ActionErrors errores, ActionMapping mapping,
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		
	}

	protected ActionForward processForward(Q70ContextoEJIE contexto, ActionErrors errors, ActionMapping mapping, 
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

		if (StringUtils.isNotEmpty(request.getParameter("indicePreaviso")))
		{
			List listaResultados=(ArrayList)contexto.get("w83aListaLotesPreavisos2");
		
			W83aLotesPreavisosBean preaviso=(W83aLotesPreavisosBean)listaResultados.get(Integer.parseInt(request.getParameter("indicePreaviso")));
			//contexto.set("w83aPreavisoNuevoBean", preaviso);
			contexto.set("codSelec",preaviso.getId8()+"_"+request.getParameter("indicePreaviso"));
			return mapping.findForward("edicion");
			
			
			
		}
		
		return mapping.findForward("error");
		
	}

}
